import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;

public class Test2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        Stack<Integer>stack=new Stack<>();
        String s="";
        int input=sc.nextInt();
        int a=input;
        while(a>0){
            stack.push(a%10);
            a=a/10;
        }
        stack.pop();
        a=input;
        int k=0;
        while(a>0){
            if(a/10==0){
                k=a;
            }
            a=a/10;
        }
        while(!stack.empty()) {
            s+= (stack.pop() + "");
        }
        s+=(k+"");
        int outCome=Integer.valueOf(s);
        System.out.println(outCome);

    }
}